package rdb

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"github.com/spf13/viper"
)

var Rdb *redis.Client

func init() {
	redisServer := fmt.Sprintf("%v", viper.Get("redis.server"))
	redisPort := fmt.Sprintf("%v", viper.Get("redis.port"))
	redisPwd := fmt.Sprintf("%v", viper.Get("redis.pwd"))
	Rdb = redis.NewClient(&redis.Options{
		Addr:     redisServer + ":" + redisPort,
		Password: redisPwd,
		DB:       0,
	})
}
